linux.kernel
[Top] [All Lists]

[PATCH 4/10] fuse: add O_NONBLOCK support to FUSE device

Subject: [PATCH 4/10] fuse: add O_NONBLOCK support to FUSE device
From: Miklos Szeredi
Date: Fri, 31 Mar 2006 20:00:33 +0200
Newsgroups: linux.kernel
From: Jeff Dike <jdike@xxxxxxxxxxx>

I don't like duplicating the connected and list_empty tests in
fuse_dev_readv, but this seemed cleaner than adding the f_flags test
to request_wait.

Signed-off-by: Jeff Dike <jdike@xxxxxxxxxxx>
Signed-off-by: Miklos Szeredi <miklos@xxxxxxxxxx>

Index: linux/fs/fuse/dev.c
===================================================================
--- linux.orig/fs/fuse/dev.c    2006-03-31 18:55:31.000000000 +0200
+++ linux/fs/fuse/dev.c 2006-03-31 18:55:31.000000000 +0200
@@ -619,6 +619,12 @@ static ssize_t fuse_dev_readv(struct fil
        err = -EPERM;
        if (!fc)
                goto err_unlock;
+
+       err = -EAGAIN;
+       if((file->f_flags & O_NONBLOCK) && fc->connected &&
+          list_empty(&fc->pending))
+               goto err_unlock;
+
        request_wait(fc);
        err = -ENODEV;
        if (!fc->connected)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at                                  www.tux.org/lkml/">http://www.tux.org/lkml/

<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy